package com.sxt.redis.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * 注入消息接受类
 *
 * @author
 */
public class RedisReceiver {

	private Logger redisReceiverLog = LoggerFactory.getLogger("redisReceiverLog");


	/**
	 * 队列消息接收方法
	 *
	 * @param jsonMsg
	 */
	public void receiveMessage(String jsonMsg) {
		//redisReceiverLog.info("[开始消费REDIS消息队列phone数据...]");
		try {
			redisReceiverLog.info("jsonMsg");
			System.out.println("[消费REDIS消息队列phone数据成功.]");
			//redisReceiverLog.info("[消费REDIS消息队列phone数据成功.]");
		} catch (Exception e) {
			redisReceiverLog.error("[消费REDIS消息队列phone数据失败，失败信息:{}]", e.getMessage());
		}
	}

	/**
	 * 队列消息接收方法
	 *
	 * @param jsonMsg
	 */
	public void receiveMessage2(String jsonMsg) {
		//redisReceiverLog.info("[开始消费REDIS消息队列chat数据...]");
		try {
			//System.out.println(jsonMsg);
			/**
			 * 此处执行自己代码逻辑 例如 插入 删除操作数据库等
			 */
			redisReceiverLog.info(jsonMsg);
			System.out.println("[消费REDIS消息队列chat数据成功.]");
			//redisReceiverLog.info("[消费REDIS消息队列chat数据成功.]");
		} catch (Exception e) {
			redisReceiverLog.error("[消费REDIS消息队列chat数据失败，失败信息:{}]", e.getMessage());
		}
	}
}
